Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Nov 22, 2022

Closes: #8178

Description

Previously, we implemented account deletion only for users who signed in with Apple (SIWA) #7068. Now that we just added account creation #7891, we should also allow any user to delete their account in the app to comply with Apple requirements.

In place of hasAppleUserID() in SettingsViewModel and StorePickerViewController, two other conditions were added as OR when the storeCreationMVP and storeCreationM2 feature flags are enabled.

Testing instructions

Without a connected store

Prerequisite: the WP.com account isn't connected to any WC stores (you can sign up for an account in the app and then dismiss the store creation flow)

  • Log in to an account that isn't connected to any WC stores (and you don't mind closing) --> there should be a Close Account CTA on the empty store picker
  • Tap on Close Account --> a confirmation alert should be shown with a text field
  • Enter the username manually
  • Tap Permanently Close Account to confirm --> an in-progress UI modal should be shown and then dismissed, and the app is back to the beginning of the login screen if the closure is successful. If there's an error (e.g. A8C account or the account owns an atomic site), an error alert should be shown

With a connected store

Prerequisite: the WP.com account is connected to at least one WC store.

  • Log in to an account in the prerequisite
  • Go to Settings --> there should be a "Close Account" button above the Log Out section
  • Tap Close Account --> a confirmation alert should be shown with a text field
  • Type in the WP.com username manually --> the destructive "Permanently Close Account" action should only be enabled when the text matches the WP.com username
  • Tap Permanently Close Account to confirm --> an in-progress UI modal should be shown and then dismissed, and the app is back to the beginning of the login screen if the closure is successful. If there's an error (e.g. A8C account or the account owns an atomic site), an error alert should be shown

Screenshots

settings empty store picker
Simulator Screen Shot - iPhone 13 Pro - 2022-11-22 at 16 04 16 Simulator Screen Shot - iPhone 14 - 2022-11-22 at 15 56 24

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@jaclync jaclync added the type: task An internally driven task. label Nov 22, 2022
@jaclync jaclync added this to the 11.4 milestone Nov 22, 2022
@peril-woocommerce
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 2 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

Copy link
Contributor

@selanthiraiyan selanthiraiyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

* trunk: (104 commits)
  Store configured NumberFormatter as static property
  Removed custom init from ButtonActivityIndicator
  Move divider spacing into constants
  Link viewmodel into existing code
  Adds convinience extension for the VM
  Rename StartCards filename to AnalyticsReportCardData
  Adds type to transmit report card data
  Update naming
  Fix linter violation
  Update naming
  Update naming
  Prefer delta over Growth
  Update domain selector view conditional logic with a state enum in the view model.
  Add helpers for calculating the delta percentage for specific analytics stats
  Simplify block with Result extension
  Remove trailing whitespace
  Simplify mocks with result.get()
  Simplify code with try?
  Add helpers for calculating the delta percentage for stats
  Update domain search placeholder.
  ...

# Conflicts:
#	WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift
#	WooCommerce/Classes/ViewRelated/Dashboard/Settings/Settings/SettingsViewController.swift
#	WooCommerce/WooCommerceTests/ViewRelated/Settings/CloseAccountCoordinatorTests.swift
* trunk: (386 commits)
  Replace escaped `U+2011` with actual character in a localized string
  Bump version number
  Update metadata translations
  Update app translations – `Localizable.strings`
  Update logged-out A/A test name and re-add logged-in A/A test.
  Update `MockInAppPurchases` `fetchProductsDuration` to nanoseconds instead of seconds.
  Try increasing `fetchProductsDuration` to fix the flaky test with a debug log.
  Add back a line that indicates that the account creation task is in progress as a regression from a previous refactoring.
  Animate navigation to store picker with store creation configuration.
  Adjust column inner spacing
  Add custom formatters to tests
  Add tests
  Inject numberOfFractionDigits as a function parameter
  Use the number of fraction digits from the store settings
  Use existing rounding extension in StatsDataTextFormatter
  Bump version number
  Use the correct stats order
  Update tests
  Update StatsDataTextFormatter to round decimals to significant numbers
  Bump version number
  ...

# Conflicts:
#	WooCommerce/Classes/Authentication/Epilogue/EmptyStoresTableViewCell.xib
@jaclync
Copy link
Contributor Author

jaclync commented Nov 30, 2022

When testing in iOS 16.1 iPhone 14 simulator, I encountered an issue when showing an alert with a text field:

[LayoutConstraints] Changing the translatesAutoresizingMaskIntoConstraints property of a UICollectionViewCell that is managed by a UICollectionView is not supported, and will result in incorrect self-sizing. View: <_UIAlertControllerTextFieldViewCollectionCell: 0x1520142b0; frame = (0 0; 270 24); gestureRecognizers = <NSArray: 0x60000210fbd0>; layer = <CALayer: 0x600002f6b720>>

There's a similar question in the developer forum. This isn't an issue in iOS 16.0 simulators, another iOS 16.1 simulator, and an iOS 16.1 device that I tested. I'm going to assume that this is a bug in the simulator, and file a bug.

@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8179-028a36a on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@jaclync jaclync merged commit a163598 into trunk Nov 30, 2022
@jaclync jaclync deleted the feat/8178-account-deletion-for-all branch November 30, 2022 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support account deletion in the app

4 participants